/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import myTest.MYTest;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 *
 * @author Invince
 */
public class PlayerConnection {
/*----------Attributs-------------------*/
    protected String clientAdd;
    protected int clientPort;
    protected Socket socket;
    protected ObjectOutputStream objOutPut;
    
/*----------Public functions------------*/
/*----------Private functions-----------*/
/*----------Constructor-----------------*/
    public PlayerConnection(String clientAdd,int clientPort) throws UnknownHostException, IOException {
        this.clientAdd = clientAdd;
        this.clientPort=clientPort;
        this.socket=new Socket(clientAdd,clientPort);
        this.objOutPut=new ObjectOutputStream(this.socket.getOutputStream());
        MYTest.println("Player Connection Created");
    }

/*----------Gets and sets---------------*/
    public String getClientAdd() {
        return clientAdd;
    }

    public void setClientAdd(String clientAdd) {
        this.clientAdd = clientAdd;
    }

    public int getClientPort() {
        return clientPort;
    }

    public void setClientPort(int clientPort) {
        this.clientPort = clientPort;
    }

    public ObjectOutputStream getObjOutPut() {
        return objOutPut;
    }

    public void setObjOutPut(ObjectOutputStream objOutPut) {
        this.objOutPut = objOutPut;
    }

    public Socket getSocket() {
        return socket;
    }

    public void setSocket(Socket socket) {
        this.socket = socket;
    }

}
